package kr.co.doriclassic.stringtokenizer;

import java.util.Scanner;
import java.util.StringTokenizer;

public class StringTokenizerEx {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("문자열 입력:");
		String s = sc.nextLine();
		StringTokenizer st = new StringTokenizer(s);
		int count = st.countTokens();
		while(st.hasMoreElements()){
			System.out.println(st.nextToken());
		}
		System.out.println("총" + count + "개의 단어가 있습니다.");		
	}
}
